<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//ZH-CN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="imagetoolbar" content="no" />
	<title>Class UI.RadioGroup</title>
	<link href="../resources/API_Help.css" type="text/css" rel="stylesheet" />
</head>

<body>
<!--打印本页-->
<div class="printCurrentPage">
	<img src="../resources/image/print.gif" align="absmiddle" />&nbsp;
	<a href="ui_RadioGroup_API.html" target="_blank">打印本页</a>
</div><br/>

<!--标题说明-->
<h1>Class UI.RadioGroup</h1>
<b>定义于文件：</b>&nbsp;&nbsp;webui.js
<div class="description">将页面对象渲染成单选框组控件。</div><br/>
<b>基本语法</b>
<div class="syntax">var radioGroup = new <b>UI.RadioGroup</b>( <em>id:String|Tag</em>,&nbsp;&nbsp;<em>name:String</em>,&nbsp;&nbsp;<em>textWidth:Number</em>,&nbsp;&nbsp;<em>radioParas:Array</em> );</div>
<b>参数说明</b>
<div class="parameter">
	<ul>
		<li><em>id</em> : String|Tag</li>
		<div class="subDesc">(必要参数) 页面单选框组标签ID或是页面单选框组标签对象。</div>
		<li><em>name</em> : String</li>
		<div class="subDesc">(必要参数) 单选框组的名字, 提交时, 后台通过单选框组的名字取得单选框组的值, 默认值：id。</div>
		<li><em>textWidth</em> : Number</li>
		<div class="subDesc">(必要参数) 单选框组内成员的文本显示宽度, 默认值：80px。</div>
		<li><em>radioParas</em> : Array</li>
		<div class="subDesc">(必要参数) 单选框组内所有成员的初始化参数集合，数组元素为初始化成员的参数。</div>
		<div class="subDesc">&nbsp;&nbsp;&nbsp;&nbsp;初始化成员的参数语法: { <em>text:String</em>,&nbsp;&nbsp;<em>value:String</em> }</div>
		<div class="subDesc">&nbsp;&nbsp;&nbsp;&nbsp;radioParas = [ 成员参数1, 成员参数2, 成员参数3, ...];</div>
	</ul>
</div>
<b>页面标签对象原型</b>
<div class="parameter">
	&lt;div&gt;&lt;/div&gt;
</div>
<b>依赖关系</b>
<div class="parameter">
	<a href="core_API.html">core.js</a>
</div><br/>
<a href="#properties">相关属性</a>&nbsp;&nbsp;-&nbsp;&nbsp;
<a href="#methods">相关方法</a>&nbsp;&nbsp;-&nbsp;&nbsp;
<a href="#events">相关事件</a>&nbsp;&nbsp;-&nbsp;&nbsp;
<a href="#examples">应用示例</a>
<hr>

<!--相关属性-->
<a name="properties"></a>
<h2>相关属性</h2>
<table width="100%" cellspacing="0">
	<tbody>
		<tr>
			<td class="tableHead" width="83%">所有属性</td>
			<td class="tableHead" width="17%">所属类</td>
		</tr>
		<tr>
			<td class="tableLineLeft">
				<a href="#UI.RadioGroup.dom" class="methodLink">UI.RadioGroup.dom</a>&nbsp;:&nbsp;&lt;div&gt;<br/>
				单选框组控件的页面容器标签对象。
			</td><td class="tableLineRight">UI.RadioGroup</td>
		</tr>
		<tr>
			<td class="tableLineLeft alt">
				<a href="#UI.RadioGroup.selectMemberIndex" class="methodLink">UI.RadioGroup.selectMemberIndex</a>&nbsp;:&nbsp;Number<br/>
				单选框组控件中最新操作的成员索引号。
			</td><td class="tableLineRight alt">UI.RadioGroup</td>
		</tr>
	</tbody>
</table>

<!--相关方法-->
<a name="methods"></a>
<h2>相关方法</h2>
<table width="100%" cellspacing="0">
	<tbody>
		<tr>
			<td class="tableHead" width="83%">所有方法</td>
			<td class="tableHead" width="17%">所属类</td>
		</tr>
		<tr>
			<td class="tableLineLeft">
				<a href="#add" class="methodLink">add</a>( { <em>text:String</em>,&nbsp;&nbsp;<em>value:String</em> } )&nbsp;:&nbsp;none<br/>
				向单选框组控件中添加一个新成员。
			</td><td class="tableLineRight">UI.RadioGroup</td>
		</tr>
		<tr>
			<td class="tableLineLeft alt">
				<a href="#count" class="methodLink">count</a>()&nbsp;:&nbsp;Number<br/>
				返回单选框组控件的成员总数。
			</td><td class="tableLineRight alt">UI.RadioGroup</td>
		</tr>
		<tr>
			<td class="tableLineLeft">
				<a href="#disable" class="methodLink">disable</a>( <em>disable:boolean</em> )&nbsp;:&nbsp;none<br/>
				设置单选框组控件是否可用。
			</td><td class="tableLineRight">UI.RadioGroup</td>
		</tr>
		<tr>
			<td class="tableLineLeft alt">
				<a href="#flowLayout" class="methodLink">flowLayout</a>( <em>layout:boolean</em> )&nbsp;:&nbsp;none<br/>
				设置单选框组控件内成员是否使用流布局。
			</td><td class="tableLineRight alt">UI.RadioGroup</td>
		</tr>
		<tr>
			<td class="tableLineLeft">
				<a href="#getSelectedMember" class="methodLink">getSelectedMember</a>()&nbsp;:&nbsp;UI.RadioGroup<br/>
				返回单选框组控件中处于选中状态的成员。
			</td><td class="tableLineRight">UI.RadioGroup</td>
		</tr>
		<tr>
			<td class="tableLineLeft alt">
				<a href="#getValue" class="methodLink">getValue</a>()&nbsp;:&nbsp;String<br/>
				返回单选框组控件中处于选中状态的成员的值。
			</td><td class="tableLineRight alt">UI.RadioGroup</td>
		</tr>
		<tr>
			<td class="tableLineLeft">
				<a href="#onChange" class="methodLink">onChange</a>( <em>callBack:Function</em> )&nbsp;:&nbsp;none<br/>
				设置单选框组控件的动作事件回调。
			</td><td class="tableLineRight">UI.RadioGroup</td>
		</tr>
		<tr>
			<td class="tableLineLeft alt">
				<a href="#removeAll" class="methodLink">removeAll</a>()&nbsp;:&nbsp;UI.RadioGroup<br/>
				清空单选框组控件中的所有成员。
			</td><td class="tableLineRight alt">UI.RadioGroup</td>
		</tr>
		<tr>
			<td class="tableLineLeft">
				<a href="#selected" class="methodLink">selected</a>( <em>value:String</em> )&nbsp;:&nbsp;none<br/>
				通过 value 设置单选框组控件中相应的成员被选中。
			</td><td class="tableLineRight">UI.RadioGroup</td>
		</tr>
	</tbody>
</table>

<!--相关事件-->
<a name="events"></a>
<h2>相关事件</h2>
<table width="100%" cellspacing="0">
	<tbody>
		<tr>
			<td class="tableHead" width="83%">所有事件</td>
			<td class="tableHead" width="17%">所属类</td>
		</tr>
		<tr>
			<td class="tableLineLeft">
				<a href="#UI.RadioGroup.onChangeEvent" class="methodLink">UI.RadioGroup.onChangeEvent</a>&nbsp;:&nbsp;Function<br/>
				单选框组控件的状态改变动作事件。
			</td><td class="tableLineRight">UI.RadioGroup</td>
		</tr>
	</tbody>
</table>
<br/>

<hr>

<!--相关属性的详细说明-->
<h2>本类属性的详细说明</h2>
<div class="detailWrap">

<a name="UI.RadioGroup.dom"></a>
<div class="mdetail">
	<h3>UI.RadioGroup.dom</h3><br/>
	<div class="mdetailDetails">
		单选框组控件的页面容器标签对象。<br/>
		通过 dom 属性可直接对单选框组控件进行操作。
	</div>
	<div class="footer since">@since JSR2.0&nbsp;&nbsp;&nbsp;&nbsp;<a href="ui_RadioGroup_API.html">Return</a></div><br/>
</div>

<a name="UI.RadioGroup.selectMemberIndex"></a>
<div class="mdetail alt">
	<h3>UI.RadioGroup.selectMemberIndex</h3><br/>
	<div class="mdetailDetails">
		单选框组控件中最新操作过的成员索引号。<br/>
	</div>
	<div class="footer since">@since JSR2.0&nbsp;&nbsp;&nbsp;&nbsp;<a href="ui_RadioGroup_API.html">Return</a></div><br/>
</div>

</div><br/>

<!--相关方法的详细说明-->
<h2>本类方法的详细说明</h2>
<div class="detailWrap">

<a name="add"></a>
<div class="mdetail">
	<h3>add</h3>
	<div class="functionDefine">public function add( { text:String, value:String } )</div>
	<div class="mdetailDetails">
		向单选框组控件中添加一个新成员。
	</div><br/>
	<div class="mdetailDetails"><b>参数</b>
		<ul>
			<li><em>text</em> : String</li>
			<div class="subDesc">新成员的显示文本, 默认值: radioButton。</div>
			<li><em>value</em> : String</li>
			<div class="subDesc">新成员的值, 默认值: radioButton。</div>
		</ul>
		<b>返回值</b>
		<ul><li>无</li></ul>
	</div>
	<div class="footer since">@since JSR2.0&nbsp;&nbsp;&nbsp;&nbsp;<a href="ui_RadioGroup_API.html">Return</a></div><br/>
</div>

<a name="count"></a>
<div class="mdetail alt">
	<h3>count</h3>
	<div class="functionDefine">public function count()</div>
	<div class="mdetailDetails">
		返回单选框组控件的成员总数。
	</div><br/>
	<div class="mdetailDetails"><b>参数</b>
		<ul><li>无</li></ul>
		<b>返回值</b>
		<ul><li>Number</li></ul>
	</div>
	<div class="footer since">@since JSR2.0&nbsp;&nbsp;&nbsp;&nbsp;<a href="ui_RadioGroup_API.html">Return</a></div><br/>
</div>

<a name="disable"></a>
<div class="mdetail">
	<h3>disable</h3>
	<div class="functionDefine">public function disable( disable:boolean )</div>
	<div class="mdetailDetails">
		设置单选框组控件是否可用。
	</div><br/>
	<div class="mdetailDetails"><b>参数</b>
		<ul>
			<li><em>disable</em> : boolean</li>
			<div class="subDesc">参数的取值&nbsp;&nbsp;&nbsp;&nbsp;true: 不可用, false: 可用。</div>
		</ul>
		<b>返回值</b>
		<ul><li>无</li></ul>
	</div>
	<div class="footer since">@since JSR2.0&nbsp;&nbsp;&nbsp;&nbsp;<a href="ui_RadioGroup_API.html">Return</a></div><br/>
</div>

<a name="flowLayout"></a>
<div class="mdetail alt">
	<h3>flowLayout</h3>
	<div class="functionDefine">public function flowLayout( layout:boolean )</div>
	<div class="mdetailDetails">设置单选框组控件内成员是否使用流布局。</div><br/>
	<div class="mdetailDetails"><b>参数</b>
		<ul>
			<li><em>layout</em> : boolean</li>
			<div class="subDesc">参数的取值&nbsp;&nbsp;&nbsp;&nbsp;true: 使用流布局, false: 不使用流布局。</div>
		</ul>
		<b>返回值</b>
		<ul><li>无</li></ul>
	</div>
	<div class="footer since">@since JSR2.0&nbsp;&nbsp;&nbsp;&nbsp;<a href="ui_RadioGroup_API.html">Return</a></div><br/>
</div>

<a name="getSelectedMember"></a>
<div class="mdetail">
	<h3>getSelectedMember</h3>
	<div class="functionDefine">public function getSelectedMember()</div>
	<div class="mdetailDetails">返回单选框组控件中处于选中状态的成员。</div><br/>
	<div class="mdetailDetails"><b>参数</b>
		<ul><li>无</li></ul>
		<b>返回值</b>
		<ul><li>UI.RadioGroup</li></ul>
	</div>
	<div class="footer since">@since JSR2.0&nbsp;&nbsp;&nbsp;&nbsp;<a href="ui_RadioGroup_API.html">Return</a></div><br/>
</div>

<a name="getValue"></a>
<div class="mdetail alt">
	<h3>getValue</h3>
	<div class="functionDefine">public function getValue()</div>
	<div class="mdetailDetails">返回单选框组控件中处于选中状态的成员的值。</div><br/>
	<div class="mdetailDetails"><b>参数</b>
		<ul><li>无</li></ul>
		<b>返回值</b>
		<ul><li>String</li></ul>
	</div>
	<div class="footer since">@since JSR2.0&nbsp;&nbsp;&nbsp;&nbsp;<a href="ui_RadioGroup_API.html">Return</a></div><br/>
</div>

<a name="onChange"></a>
<div class="mdetail">
	<h3>onChange</h3>
	<div class="functionDefine">public function onChange( callBack:Function )</div>
	<div class="mdetailDetails">设置单选框组 onChangeEvent 的动作事件回调。<br/>
	当触发单选框组的动作事件时, 系统会自动将触发事件的成员做为 this 调用 callBack 方法。</div><br/>
	<div class="mdetailDetails"><b>参数</b>
		<ul>
			<li><em>callBack</em> : Function</li>
			<div class="subDesc">回调函数名。</div>
		</ul>
		<b>返回值</b>
		<ul><li>无</li></ul>
	</div>
	<div class="footer since">@since JSR2.0&nbsp;&nbsp;&nbsp;&nbsp;<a href="ui_RadioGroup_API.html">Return</a></div><br/>
</div>

<a name="removeAll"></a>
<div class="mdetail alt">
	<h3>removeAll</h3>
	<div class="functionDefine">public function removeAll()</div>
	<div class="mdetailDetails">清空单选框组控件中的所有成员。</div><br/>
	<div class="mdetailDetails"><b>参数</b>
		<ul><li>无</li></ul>
		<b>返回值</b>
		<ul><li>无</li></ul>
	</div>
	<div class="footer since">@since JSR2.0&nbsp;&nbsp;&nbsp;&nbsp;<a href="ui_RadioGroup_API.html">Return</a></div><br/>
</div>

<a name="selected"></a>
<div class="mdetail">
	<h3>selected</h3>
	<div class="functionDefine">public function selected( value:String  )</div>
	<div class="mdetailDetails">通过 value 设置单选框组控件中相应的成员被选中。</div><br/>
	<div class="mdetailDetails"><b>参数</b>
		<ul>
			<li><em>value</em> : String</li>
			<div class="subDesc">成员的值。</div>
		</ul>
		<b>返回值</b>
		<ul><li>无</li></ul>
	</div>
	<div class="footer since">@since JSR2.0&nbsp;&nbsp;&nbsp;&nbsp;<a href="ui_RadioGroup_API.html">Return</a></div><br/>
</div>

</div><br/>

<!--相关事件的详细说明-->
<h2>本类事件的详细说明</h2>
<div class="detailWrap">

<a name="UI.RadioGroup.onChangeEvent"></a>
<div class="mdetail">
	<h3>UI.RadioGroup.onChangeEvent</h3><br/>
	<div class="mdetailDetails">
		单选框组控件中, 成员状态改变动作事件。<br/>
		在改变单选框组中成员的选择状态时将会触发此事件, 具体的应用请参见方法 <a href="#onChange" class="methodLink">onChange</a> 的说明。
	</div>
	<div class="footer since">@since JSR2.0&nbsp;&nbsp;&nbsp;&nbsp;<a href="ui_RadioGroup_API.html">Return</a></div><br/>
</div>

</div><br/>

<!--应用示例-->
<a name="examples"></a>
<h2>应用示例</h2>
<div class="properties"><a href="../Example/ui_RadioGroup.html" target="_blank">ui_RadioGroup.html</a></div><br/>

<!--页脚-->
<hr>
<div class="footer">JSR - Copyright &copy; 2007-2008 Jsr JS, LLC<br/>All rights reserved.</div>
</body>
</html>
